package cn.bearspark.user.provider.rpc;

import cn.bearspark.user.dto.UserAtDTO;
import cn.bearspark.user.provider.service.UserAtService;
import cn.bearspark.user.rpc.UserAtRpc;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author f
 */
@Component
@DubboService
public class UserAtRpcImpl implements UserAtRpc {

    private final UserAtService userAtService;

    public UserAtRpcImpl(UserAtService userAtService) {
        this.userAtService = userAtService;
    }

    @Override
    public void addAtUsernameList(int moduleCode, long moduleDataId, List<String> atUsernameList) {
        userAtService.addAtUsernameList(moduleCode, moduleDataId, atUsernameList);
    }

    @Override
    public Map<Long, List<UserAtDTO>> mapAtUsernameSet(int moduleCode, Set<Long> moduleDataIdSet) {
        return userAtService.mapAtUsernameSet(moduleCode, moduleDataIdSet);
    }

    @Override
    public void delete(int moduleCode, long moduleDataId) {
        userAtService.delete(moduleCode, moduleDataId);
    }
}
